﻿using Cherry.Agile.Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace Cherry.Agile.Enterprise.Services.Interface
{
    [ServiceContract(Namespace = Unity.Namespace)]
    public interface IAuthorizationService
    {
        /// <summary>
        /// 获取一个用户
        /// </summary>
        /// <param name="identity">票据</param>
        /// <returns>用户信息</returns>
        [OperationContract]
        User GetUser(AccountTicket ticket);

        /// <summary>
        /// 获取用户角色信息
        /// </summary>
        /// <param name="identity">票据</param>
        /// <returns>用户信息</returns>
        [OperationContract]
        Role[] GetUserRoles(AccountTicket tiket);

        /// <summary>
        /// 获取用户组织信息
        /// </summary>
        /// <param name="identity">票据</param>
        /// <returns>用户信息</returns>
        [OperationContract]
        Organization[] GetUserOrgs(AccountTicket tiket);
    }
}
